using System;
using System.Collections.Generic;
namespace Omabar.Model
{
    /// <summary>
    /// 航班
    /// </summary>
    public partial class FLIGHT
    {
        public string FLIGHT_ID { get; set; }
        public string FLIGHT_CODE { get; set; }
        public string FLIGHT_CITY_START { get; set; }
        public string FLIGHT_CITY_END { get; set; }
        public System.DateTime FLIGHT_TIME_START { get; set; }
        public System.DateTime FLIGHT_TIME_END { get; set; }
        public int FLIGHT_PRICE { get; set; }
        public string FLIGHT_TIME
        {
            get
            {
                TimeSpan ts = FLIGHT_TIME_END - FLIGHT_TIME_START;
                int hours = (int)ts.TotalHours;
                int minutes = (int)Math.Round((ts.TotalHours - hours) * 60);

                return hours + "小时" + (minutes > 0 ? minutes + "分钟" : "");
            }
        }
    }
}
